const prettier = require('prettier/standalone');
const prettierBabylon = require('prettier/parser-babylon');

exports.prettier = (json, opts = { printWidth: 120 }) =>
  prettier.format(JSON.stringify(json), {
    parser: 'json',
    printWidth: opts.printWidth,
    plugins: [ prettierBabylon ]
  });
